#include "keys.h"
#include "encrypt.h"
#include <stddef.h>
#include <stdint.h>

bool GenerateKey()
{
    BinaryData finalKey = {NULL, 0};
    finalKey = encrypt();
    if (!finalKey.data || finalKey.length == 0)
        return false;
    return saveFinalKey("/root/test_fyc/sslkey", finalKey);
}

bool VerifyKey()
{
    BinaryData finalKey = {NULL, 0};
    BinaryData fileKey = {NULL, 0};
    finalKey = encrypt();
    if (!finalKey.data || finalKey.length == 0)
        return false;

    fileKey = getFileKey("/root/test_fyc/sslkey");
    if (!fileKey.data || fileKey.length == 0)
        return false;
    return compareResult(finalKey, fileKey);
}

bool changeData(unsigned char *data)
{
    return modHtsc2Data(data);
}